<div id="divList" >
    <?php echo View::factory('admin/common/breadcrumbs')->set('breadcrumbs', $breadcrumbs)->render(); ?>
    <style>
        [class^="icon-"], [class*=" icon-"]{
            line-height: inherit;
        }
    </style>
    <form id='frmlist' onsubmit="return false;">
        <div class="page-content">
            <div class="page-header">
                <h1 data-bind="text:title">
                    <?= $title ?> 
                </h1>
            </div><!-- /.page-header -->
            <?php echo View::factory('admin/common/messege')->render(); ?>
            <div class="row" style="height: 100px;">
                <div class="col-sm-9">
                    <div id="sample-table-2_length" class="dataTables_length">
                        <div class="col-xs-12 col-sm-6">
                            <div class="input-group">
                                <input type="text" placeholder="Enter a name for search" value="<?= Arr::get($_REQUEST, 'textsearch') ?>" class="form-control search-query" id="textsearch" name="textsearch"  >
                                <span class="input-group-btn">
                                    <button class="btn btn-purple btn-sm" id="cmdSearch" type="button">
                                        Search
                                        <i style="line-height:normal;" class="icon-search icon-on-right bigger-110"></i>
                                    </button>
                                </span>
                            </div>
                        </div>

                    </div>
                </div>
                <div class="h4 col-sm-9">&nbsp;</div>
                <div class="col-sm-9">
                    <div id="sample-table-2_length" class="col-sm-4">
                        <div class="clearfix">
                            <div>
                                <label class="blue">
                                    <input type="radio" class="ace active-check" value="1" checked="" name="active" id="inactive">
                                    <span class="lbl"> Active</span>
                                </label>
                                &nbsp;&nbsp;
                                <label class="blue">
                                    <input type="radio" class="ace active-check" value="0" name="active" id="active">
                                    <span class="lbl"> In-active</span>
                                </label>
                            </div>
                        </div>
                    </div>

                    
                </div>

                

                <div class="col-sm-12">
                    <div class="dataTables_filter" id="sample-table-2_filter">
                        Order by&nbsp;
                        <select id='sortname' name="sortname">
                            <option value='fname'>Name</option>
                            <option value='cell_phone'>Phone</option>
                            <option value='email'>Email</option>
                            <option value='office_location'>Address</option>
                        </select>
                        &nbsp;&nbsp;Order type:&nbsp;
                        <select id='sortdir' name="sortdir">
                            <option value='asc'>ASC</option>
                            <option value='desc'>DESC</option>
                        </select>
                        &nbsp;
                        <button value="Apply" id="cmdSort" type="button" class="btn btn-xs btn-primary ">
                            <i class="align-top bigger-125  icon-check orange"></i>
                            Apply
                        </button>
                    </div>
                </div>
            </div>
            <div class="hr hr-18 dotted hr-double"></div>
            <div class="row">
                <div class="col-xs-12">
                    <!-- PAGE CONTENT BEGINS -->

                    <div class="row">
                        <div class="col-xs-12">
                            <div class="table-responsive dataTables_wrapper">
                                <table id="list-table-1" class="table table-striped table-bordered table-hover">
                                    <thead>
                                        <tr>
    <!--                                        <th class="center">
                                                <label>
                                                    <input type="checkbox" class="ace" />
                                                    <span class="lbl"></span>
                                                </label>
                                            </th>-->
                                            <th>Information</th>
                                            <th style="text-align: center;">Image</th>
                                            <th></th>
                                        </tr>
                                    </thead>
                                    <tbody data-bind="foreach: { data: users, as: 'user' }">
                                        <?php
                                        if (empty($a_user)) {
                                            $a_user[0] = new Model_User();
                                        }
                                        foreach ($a_user as $obj) {
                                            $en_user = $obj->get_data();
                                            ?>
                                            <tr <?= (int) $en_user->getId() <= 0 ? 'style="display:none;" class="tr-show"' : '' ?>>
        <!--                                            <td class="center">
                                                    <label>
                                                        <input type="checkbox" class="ace" />
                                                        <span class="lbl"></span>
                                                    </label>
                                                </td>-->

                                                <td>
                                                    <b>
                                                        <span style="color:rgb(102,102,102)">Name: </span>
                                                        <span data-bind="text:user.name"><?= $en_user->getlName() . " " . $en_user->getfname(); ?></span>
                                                    </b>&nbsp;

                                                    <br>
                                                    <span style="color:rgb(102,102,102)">Phone: </span>
                                                    <span data-bind="text:user.phone"><?= $en_user->getphone(); ?> </span>&nbsp;
                                                    <br>
                                                    <span style="color:rgb(102,102,102)">Email: </span>&nbsp;
                                                    <a  style="color:rgb(160,114,94)" data-bind="attr:{'mailto':user.email}" href="mailto:<?= $en_user->getEmail(); ?>">
                                                        <span data-bind="text:user.email"><?= $en_user->getEmail(); ?></span>
                                                    </a>
                                                    <br><span style="color:rgb(102,102,102)">Address: </span>
                                                    <span data-bind="text:user.address"><?= $en_user->gethouse_number() ?></span>&nbsp;
                                                    <br>
                                                    &nbsp;<a class='classViewDetail' style="color:rgb(160,114,94)" href="javascript:;" data-bind="attr:{'itemid':user.id}" itemid="<?= $en_user->getId() ?>">More Information</a></td>

                                                <td style="text-align: center;">
                                                    <?php
                                                    if (trim($en_user->getimagename()) != "") {
                                                        $imagename = $url_base_media . "/" . Controller_Helper_Constant::FOLDER_AVATAR . "/" . $en_user->getimagename();
                                                    } else {
                                                        $imagename = $url_base_media . "/assets/img/avatars/profile-pic.jpg";
                                                    }
                                                    ?>
                                                    <img src="<?= $imagename ?>" width="100px" data-bind="attr:{'src':user.imagename}" />
                                                </td>

                                                <td>
                                                    <div class="visible-md visible-lg hidden-sm hidden-xs btn-group">
                                                        <button type="button" class="btn btn-xs btn-info classEdit" data-bind="attr:{'itemid':user.id}" itemid="<?= $en_user->getId() ?>">
                                                            <i class="icon-edit bigger-120"></i>
                                                        </button>

                                                        <button type="button" class="btn btn-xs btn-danger classDelete" data-bind="attr:{'itemid':user.id}" itemid="<?= $en_user->getId() ?>">
                                                            <i class="icon-trash bigger-120"></i>
                                                        </button>
                                                    </div>

                                                    <div class="visible-xs visible-sm hidden-md hidden-lg">
                                                        <div class="inline position-relative">
                                                            <button type="button" class="btn btn-minier btn-primary dropdown-toggle" data-toggle="dropdown">
                                                                <i class="icon-cog icon-only bigger-110"></i>
                                                            </button>
                                                            <ul class="dropdown-menu dropdown-only-icon dropdown-yellow pull-right dropdown-caret dropdown-close">

                                                                <li>
                                                                    <a href="javascript:;" class="tooltip-success classEdit" data-rel="tooltip" title="Edit" data-bind="attr:{'itemid':user.id}" itemid="<?= $en_user->getId() ?>">
                                                                        <span class="green">
                                                                            <i class="icon-edit bigger-120"></i>
                                                                        </span>
                                                                    </a>
                                                                </li>

                                                                <li>
                                                                    <a href="javascript:;" class="tooltip-error classDelete" data-rel="tooltip" title="Delete" data-bind="attr:{'itemid':user.id}" itemid="<?= $en_user->getId() ?>">
                                                                        <span class="red">
                                                                            <i class="icon-trash bigger-120"></i>
                                                                        </span>
                                                                    </a>
                                                                </li>
                                                            </ul>
                                                        </div>
                                                    </div>
                                                </td>
                                            </tr>
                                            <?php
                                        }
                                        ?>
                                    </tbody>
                                </table>
                                <div class="row">
                                    <div class="col-sm-6">
                                        <div class="dataTables_info" id="sample-table-2_info"></div>

                                    </div>
                                    <div class="col-sm-6" data-bind="html:pagination ">
                                        <?= $pagination; ?>

                                    </div>
                                </div>
                            </div><!-- /.table-responsive -->
                        </div><!-- /span -->
                    </div><!-- /row -->

                </div><!-- /.col -->
            </div><!-- /.row -->
        </div><!-- /.page-content -->
        <script>
        var _user_list = user_list.CreateObject({
            id: '_user_list',
            full_url: '<?= Controller_Helper_Url::full_url() ?>'
        });
        </script>
    </form>

    <div id="modal-delete" class="modal fade" tabindex="-1">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header no-padding">
                    <div class="table-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                            <span class="white">&times;</span>
                        </button>
                        Delete
                    </div>
                </div>

                <div class="modal-body no-padding">
                    <div style="padding: 20px;">
                        Are you sure delete this user?
                    </div>
                </div>

                <div class="modal-footer no-margin-top">
                    <button type="button" class="btn btn-sm pull-right" data-dismiss="modal">
                        <i class="icon-remove"></i>
                        Close
                    </button>
                    <div class="pull-right">
                        &nbsp;
                    </div>
                    <button type="button" class="btn btn-sm btn-danger pull-right" id="cmdDelete">
                        <i class="icon-remove"></i>
                        Delete
                    </button>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div><!-- PAGE CONTENT ENDS -->
</div>

<div id="divEdit" style='display: none;'>

</div>

<div id="divViewDetail" style='display: none;'>

</div>